-
Notifications
You must be signed in to change notification settings - Fork 6
User management interface #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a77d532 to
5be6aac
Compare
app/views/layouts/_sidebar.html.erb
Outdated
|
|
||
| <li class="sidebar-item "> | ||
| <a href="application-chat.html" class='sidebar-link'> | ||
| <a href="<%= users_path%>" class='sidebar-link'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use a link_to rather than an href... something like:
<%= link_to users_path, class: 'sidebar-link' do %>
<i class="bi bi-people"></i>
<span>Users</span>
<% end %>
app/views/layouts/mazer.html.erb
Outdated
|
|
||
| <body> | ||
| <!-- Only for connexion and reset password not display sidebar --> | ||
| <% unless current_page?('/connexion') || current_page?('/reset_password') %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think /connexion isn't a rails convention.
app/views/layouts/mazer.html.erb
Outdated
| <body> | ||
| <!-- Only for connexion and reset password not display sidebar --> | ||
| <% unless current_page?('/connexion') || current_page?('/reset_password') %> | ||
| <%= render "layouts/sidebar" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have a different layout all together for the session stuff. Like a session layout session.html.erb that is going to be specific for the password/login/etc
| root "home#index" | ||
| get "home/index", as: :home | ||
| resource :session | ||
| resources :passwords, param: :token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like we shouldn't change these away from the rails defaults.
spec/requests/users_spec.rb
Outdated
| @@ -0,0 +1,123 @@ | |||
| require "rails_helper" | |||
|
|
|||
| # This spec was generated by rspec-rails when you ran the scaffold generator. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably remove all the comments.
| end | ||
| end | ||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra space here can be removed
| def new | ||
| @user = User.new | ||
| end | ||
| def edit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add space before this method
app/views/users/index.html.erb
Outdated
| <div class="card"> | ||
| <div class="card-body"> | ||
|
|
||
| <i class="bi bi-plus"></i> <%= link_to "New User?",new_user_path, class:'btn btn-primary'%> </i> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want to do this like:
<%= link_to new_region_path, class: "btn btn-primary" do %>
<i class="bi bi-plus"></i> Add New User
<% end %>
676b7c2 to
0a2d2b3
Compare
…gn for session/new, session controler : layout -> mazer
… password, condition in layout mazer
This commit removes/adds spaces where needed, removes unnecessary comments and changes <a> to link_to in the sidebar. There are still some other <a> in the sidebar that I haven't changed yet as other people are in the process of adding routes to these pages (Topics and Languages).
0a2d2b3 to
918e7b1
Compare
As per Sean's suggested changes, I have removed the "connexion" and "reset_password" routes to use the default Rails conventions. I have also fixed indendation and added some tests for login and password reset.
918e7b1 to
c2b6925
Compare
What Issue Does This PR Cover, If Any?
Resolves #9
What Changed? And Why Did It Change?
How Has This Been Tested?
Rspec
Please Provide Screenshots
Additional Comments